//去除字符串tailing and heading空格
String.prototype.Trim =function() { 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
}
//去除字符串左侧空格
String.prototype.LTrim =function() { 
	return this.replace(/(^\s*)/g, ""); 
}
//去除字符串右侧空格
String.prototype.RTrim =function() { 
	return this.replace(/(\s*$)/g, ""); 
}


function wait( func, time )
{
	var int=self.setInterval("clock()",50);
	int=window.clearInterval(int);
}

function getUrlAndDo( data, url, func )
{
    $.ajax({type: "POST", url: url, data: data, success: function(str){
        var info = "var result=" + str +';';
        try{
            eval(info);
        } catch(exception) {
            myWindow=window.open('','','width=1000,height=1200');
            myWindow.document.write(str);
            myWindow.focus();
			return;
        }
        if(result['ret'] && func){
			func(result);
        }
    }});
}